<ion-header>
    <ion-toolbar>
        <ion-buttons left>
            <button ion-button navPop>
                <i class="backIcon"></i>
            </button>
        </ion-buttons>
        <ion-title>
            {{rosterFilteModel.classify ===0 ? '客户名单筛选' : '增员名单筛选'}}
        </ion-title>
    </ion-toolbar>
</ion-header>
<ion-content>
    <div class="content-rel">
        <div class="row row-title" *ngIf="rosterFilteModel.classify===0">
            活动类型
        </div>
        <div class="row" *ngIf="rosterFilteModel.classify===0">
            <div class="filter-btn filter-btn_long"
                 [class.filter-btn_selected]="isSelectBtn('type', item.id)"
                 (click)="changeFilter('type', item.id)" *ngFor="let item of typeList">{{item.name}}
            </div>
        </div>
        <div class="row row-title">
            活动状态
        </div>
        <div class="row">
            <div class="filter-btn filter-btn_long"
                 [class.filter-btn_selected]="isSelectBtn('status', item.id)"
                 (click)="changeFilter('status', item.id)" *ngFor="let item of statusList">{{item.name}}
            </div>
        </div>
        <div class="row row-title">
            <div>活动开始时间</div>
            <button class="clear-btn"
                    *ngIf="rosterFilteModel.starttime || rosterFilteModel.endtime" (click)="cleanTime()">清除
            </button>
        </div>
        <div class="row">
            <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/M/D" pickerFormat="YYYYMMDD"
                          yearValues="{{yearList}}"
                          (ionChange)="validateForm()"
                          [pickerOptions]="pickerOption" [(ngModel)]="rosterFilteModel.starttime">
            </ion-datetime>
            <div class="datetime-Separator"></div>
            <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/M/D" pickerFormat="YYYYMMDD"
                          yearValues="{{yearList}}"
                          (ionChange)="validateForm()"
                          [pickerOptions]="pickerOption" [(ngModel)]="rosterFilteModel.endtime">
            </ion-datetime>
        </div>
        <div class="row row-title"  *ngIf="rosterFilteModel.classify===1">
            <div>活动参与时间</div>
            <button class="clear-btn"
                    *ngIf="rosterFilteModel.startTakeTime || rosterFilteModel.endTakeTime" (click)="cleanTakeTime()">清除
            </button>
        </div>
        <div class="row"  *ngIf="rosterFilteModel.classify===1">
            <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/M/D" pickerFormat="YYYYMMDD"
                          yearValues="{{yearList}}"
                          (ionChange)="validateForm2()"
                          [pickerOptions]="pickerOption" [(ngModel)]="rosterFilteModel.startTakeTime">
            </ion-datetime>
            <div class="datetime-Separator"></div>
            <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/M/D" pickerFormat="YYYYMMDD"
                          yearValues="{{yearList}}"
                          (ionChange)="validateForm2()"
                          [pickerOptions]="pickerOption" [(ngModel)]="rosterFilteModel.endTakeTime">
            </ion-datetime>
        </div>
        <div class="row row-title" *ngIf="activityList && activityList.length>0">
            <span>活动名称</span>
            <span class="filter-expand"
                  (click)="isExpandName = !isExpandName"
                  [class.filter-expand_down]="isExpandName"></span>
        </div>
        <div class="row" [class.collapse]="!isExpandName">
            <div class="filter-btn filter-btn_long"
                 [class.filter-btn_selected]="isSelectBtn('ids', item.id)"
                 (click)="changeFilter('ids', item.id)" *ngFor="let item of activityList">{{item.shortName}}
            </div>
        </div>
        <div class="row row-title">跟进状态</div>
        <div class="row" *ngIf="rosterFilteModel.classify===0">
            <div class="filter-btn filter-btn_long"
                 [class.filter-btn_selected]="isSelectBtn('trackStatus', item.id)"
                 (click)="changeFilter('trackStatus', item.id)" *ngFor="let item of followList">{{item.name}}
            </div>
        </div>
        <div class="row" *ngIf="rosterFilteModel.classify===1">
            <div class="filter-btn filter-btn_long"
                 [class.filter-btn_selected]="isSelectBtn('trackStatus', item.id)"
                 (click)="changeFilter('trackStatus', item.id)" *ngFor="let item of followList2">{{item.name}}
            </div>
        </div>
    </div>
</ion-content>
<ion-footer>
    <ion-row>
        <ion-col>
            <button ion-button class="foot-btn_reset" (click)="resetForm()">重置</button>
        </ion-col>
        <ion-col>
            <button ion-button class="foot-btn_done" [disabled]="!canSubmit" (click)="doSearch()">查询</button>
        </ion-col>
    </ion-row>
</ion-footer>
